create procedure cms_sp_ModuleAdd
(
	@Id int = null output,
	@SiteGroupId int,
    @SiteId int,
    @PackageId int,
    @ModuleName nvarchar(250),
    @ModuleDescription nvarchar(max),
    @ModuleViewParameters xml,
    @ModuleCommonParameters xml,
    @CreatedBy int,
    @DateCreated datetime,
    @LastUpdatedBy int,
    @DateLastUpdated datetime
)
as
begin
INSERT INTO [dbo].[Modules]
           ([SiteGroupId]
           ,[SiteId]
           ,[PackageId]
           ,[ModuleName]
           ,[ModuleDescription]
           ,[ModuleViewParameters]
           ,[ModuleCommonParameters]
           ,[CreatedBy]
           ,[DateCreated]
           ,[LastUpdatedBy]
           ,[DateLastUpdated])
     VALUES
           (@SiteGroupId
           ,@SiteId 
           ,@PackageId
           ,@ModuleName
           ,@ModuleDescription
           ,@ModuleViewParameters 
           ,@ModuleCommonParameters 
           ,@CreatedBy 
           ,@DateCreated 
           ,@LastUpdatedBy 
           ,@DateLastUpdated )
set @Id = SCOPE_IDENTITY()
return @Id
end           
GO


